From 27e3a313fc385520571d931d5387af7c60e52260 Mon Sep 17 00:00:00 2001 From: oliskoli Date: Wed, 19 Apr 2006 23:17:55 +0000 Subject: [PATCH] Fix 'Invalid free' detected by valgrind. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@1917 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/geoniche.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gpsbabel/geoniche.c b/gpsbabel/geoniche.c index e5bf8e6aa..8ec4765ed 100644 --- a/gpsbabel/geoniche.c +++ b/gpsbabel/geoniche.c @@ -630,7 +630,10 @@ geoniche_geostuff(const waypoint *wpt) xfree(tmp2); xfree(tmp3); - return enscape(gs); + tmp1 = enscape(gs); + xfree(gs); + + return tmp1; } static void @@ -687,10 +690,8 @@ geoniche_writewpt(const waypoint *wpt) gs = geoniche_geostuff(wpt); if (gs) { - char *newnotes = xstrappend(notes, gs); - xfree (notes); + notes = xstrappend(notes, gs); xfree (gs); - notes = newnotes; } vdata = (ubyte *) xmalloc(vsize); -- 2.30.2